<?php
	class DBConn {
		/* 本機測試*/
		private $conn = null;
		private $userName ="root";
	    private $password ="";
	    private $database = "ad";
	    private $host ="localhost:3306";

	   /*AD 正式環境*/
//		private $userName ="mmediaai";
//	    private $password ="80165600";
//	    private $database = "mmediaai_ad";
//	    private $host ="localhost:3306";
	    
	    
		public function DBConn() {
			$this->open();
		}
		
		public function open() {
			$this ->conn = @mysql_connect($this->host, $this->userName ,$this->password);
			@mysql_query("SET NAMES utf8");
			@mysql_query("SET CHARACTER_SET_RESULTS= utf8", $this->conn);
			@mysql_select_db($this->database);	 
		}
		
		public function getConn(){
			return $this ->conn;
		}
		
		public function close() {
			@mysql_close(conn);
		}
	}
?>